<template>
  <Row>

  <Col :span="24">
    <chart :options="option" class="echarts"></chart>

  </Col>

  </Row>
</template>

<style scoped>
.echarts {
  height: 500px;
  width: 100%;
  border-radius: 25px;
}

</style>

<script>
 import fetch from '../../utils/fetch';

export default {
  data: function () {
        return {
            // 指定图表的配置项和数据
             option : {}
        }
   },
   mounted:function(){
        fetch({
            url:"stat/factorySale",
            method:"get"
        }).then(resp=>{
            this.option = {
                title: {
                    text: '厂家销售情况'
                },
                tooltip: {},
                    legend: {
                    data:['销量']
                },
                xAxis: {
                    data: resp.data.titles
                },
                yAxis: {},
                    series: [{
                    name: '销量',
                    type: 'bar',
                    data: resp.data.datas
                }]
            }
        })
    }
}

</script>